<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>${bean.name}表单编辑器</title>
<link rel="stylesheet"
	href="${sbase}scripts/codemirror2/lib/codemirror.css" />
<script src="${sbase}scripts/codemirror2/lib/codemirror.js"></script>
<script src="${sbase}scripts/codemirror2/mode/xml/xml.js"></script>
<link rel="stylesheet"
	href="${sbase}scripts/codemirror2/theme/default.css" />
<link rel="stylesheet" href="${sbase}scripts/codemirror2/css/docs.css" />

<style type="text/css">
.CodeMirror {
	border-top: 1px solid black;
	border-bottom: 1px solid black;
}

.activeline {
	background: #f0fcff !important;
}
#editor {
	width: 100%;
	height: 800px;
}
</style>
<script type="text/javascript" src="${base}scripts/tools.js"></script>
</head>

<body>
	<h2>编辑表单 ${bean.name} 内容</h2>
	<form action="admin/form/form-manager!update2" target="_self"
		method="post">
		<input type="submit" value="保存" /> <input type="hidden" name="bean.id"
			value="${bean.id }" />
		<textarea id="editor" name="bean.content"><c:out value="${bean.content}" escapeXml="true"></c:out></textarea>

	</form>
	<script type="text/javascript">
var editor = CodeMirror.fromTextArea(
		document.getElementById("editor"),
		{
			mode: "application/xml",
		  	lineNumbers: true,
		  	onCursorActivity: function() {
		    	editor.setLineClass(hlLine, null);
		    	hlLine = editor.setLineClass(editor.getCursor().line, "activeline");
		    }				
		});
var hlLine = editor.setLineClass(0, "activeline");

</script>
</body>
</html>